//
//  Header.h
//  River
//
//  Created by iMacOne on 15/11/27.
//  Copyright © 2015年 iMacOne. All rights reserved.
//




#import "ReduceCode.h"
//#import "ImageUtil.h"
//#import "BaseView.h"
//#import "Helper.h"
//#import <UIImageView+WebCache.h>

#import "SingletonPatt.h"

#import "UIView+JDExtension.h"

#import "ToolUtil.h"

#import "UIButton+ImageTitleSpacing.h"
#import "UIButton+Block.h"

#import "UILabel+Wonderful.h"

#import "SGTopTitleView.h"

#import<pop/POP.h>


#import "UIView+SDAutoLayout.h"

//#import "UITableView+SDAutoTableViewCellHeight.h"
//#import "SDTimeLineCellCommentView.h"

//#import "SDWeiXinPhotoContainerView.h"

//#import "SDTimeLineCellOperationMenu.h"
//#import "UIViewController+YQSlideMenu.h"

//#import <IQKeyboardManager/IQKeyboardManager.h>




#pragma mark selfDefine


#define WeChatKey    @"wx054406f5ccd828da"
#define WeChatSecret @"fcc43444718db46ce38abe82b65de36a"

#define  k_MAINAPPNAME @"JIAYIJINFUAPP"


#define RGB_COLOR(R,G,B)  [UIColor colorWithRed:R / 255.0 green:G / 255.0 blue:B / 255.0 alpha:1.0]
#define GRAYCOLOR [UIColor colorWithRed:241/255.0 green:241/255.0 blue:241/255.0 alpha:1.0]
#define WindowWidth [UIScreen mainScreen].bounds.size.width
#define WindowHeight [UIScreen mainScreen].bounds.size.height


#define DEBUG_CLOLR [UIColor colorWithRed:(arc4random() % 4 + 252) / 255.0 green:(arc4random() % 21 + 230) / 255.0 blue:(arc4random() % 40 + 201) / 255.0 alpha:1.0]
#define Width [UIScreen mainScreen].bounds.size.width/375
#define Height [UIScreen mainScreen].bounds.size.height/667

//#define NUMBER(A) [UIFont fontWithName:@"AvenirNextCondensed-Bold" size:A]
#define NUMBER(A) [UIFont systemFontOfSize:A]
//#define ENGLISH(A) [UIFont fontWithName:@"Didot-Bold" size:A]
//#define ENGLISH(A) [UIFont systemFontOfSize:A]

/********颜色相关宏***********/
//十六进制颜色
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define kColor(R,G,B,A) [UIColor colorWithRed:R/255.f green:G/255.f blue:B/255.f alpha:A]

#define kWhiteColor    [UIColor whiteColor]
#define kLightGrayColor [UIColor lightGrayColor]
#define kBlueColor      [UIColor blueColor]
#define kBlackColor     [UIColor blackColor]
#define kClearColor     [UIColor clearColor]
#define kGrayColor      [UIColor grayColor]
#define kRedColor       [UIColor redColor]
#define kYellowColor    [UIColor yellowColor]
#define kGreenColor     [UIColor greenColor]

#define HOME_COLOR UIColorFromRGB(0x3781f0)

#define k_TableBackColor  UIColorFromRGB(0xefeff4) // 背景颜色


#define  K_WireColor UIColorFromRGB(0x6c93a5)

//#define  K_LineColor  UIColorFromRGB(0xc9d7e0)
#define  K_LineColor  UIColorFromRGB(0xe3e3e3)
#define  K_LineColorTWO  UIColorFromRGB(0xe3e3e3)


#define  K_ATTRNCOLOR  UIColorFromRGB(0xf5f5f5)  //已关注颜色


#define juhuang [ImageUtil colorWithRgb:0xff7f00]

#define JCColor(R,G,B,A) [UIColor colorWithRed:R/255.f green:G/255.f blue:B/255.f alpha:A]

#define dixian [ImageUtil colorWithRgb:0xf7f2f2]



#define dise    UIColorFromRGB(0xf7f6f2) //[ImageUtil colorWithRgb:0xf7f6f2]


#define kLineColor UIColorFromRGB(0xefeff4) //浅色(较浅)

//#define  K_LineColor  UIColorFromRGB(0xcccccc)  // [ImageUtil colorWithRgb:] //浅色 (较深)

#define k_LabelGreeColor [ImageUtil colorWithRgb:0x666666] //深色

//=======快捷工具============//

#define k_TabBarHeight 49
#define k_NavigationHeight 64

#define kMaxX(X) CGRectGetMaxX(X)
#define kMaxY(Y) CGRectGetMaxY(Y)

#define kMinX(X) CGRectGetMinX(X)
#define kMinY(Y) CGRectGetMinY(Y)


#define VALUEFORKEY(ITEM,KEY) [ITEM valueForKey:KEY]
#define VALUEFORKEYPATH(ITEM,KEY) [ITEM  valueForKeyPath:KEY]


#define FONT(A) [UIFont systemFontOfSize:A]

#define NSURL(url) [NSURL URLWithString:url]

#define IMAGE(A) [UIImage imageNamed:A]

#define NSString(TYPE,STR) [NSString stringWithFormat:TYPE,STR]

#define ISEQUALTO(Class,item )  [Class isEqualToString:item]
#define PROMPT(item) [ToolUtil blackColorLabel:item];

#define ADAPTIONWEIGHT(STR,WIDTH,HEIGHT,NUM) [ToolUtil autoWidth:STR width:WIDTH height:HEIGHT num:NUM]

#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kWidth(R) (R)*(kScreenWidth)/320
#define kHeight(R) (iPhone4?((R)*(kScreenHeight)/480):((R)*(kScreenHeight)/568))




//=========本地数据==================//
#define SaveDefault(Object,Key)  [[NSUserDefaults standardUserDefaults]setObject:Object forKey:Key]

#define RemoVeDefault(Key) [[NSUserDefaults standardUserDefaults]removeObjectForKey:Key]

#define GetObjDefault(Key) [[NSUserDefaults standardUserDefaults]objectForKey:Key]




#define currentVersionKey  GetObjDefault(@"currentVersionKey")  //获取当前版本号

#define k_USERID         GetObjDefault(@"USER_ID")//@"150"
//
//
#define k_NICK_NAME       GetObjDefault(@"NICK_NAME")//用户昵称
//
//
#define K_USER_PHOTO      GetObjDefault(@"USER_PHOTO")//用户头像

//
//#define k_USER_SEX            GetObjDefault(@"USER_SEX")
//
//
//#define k_USER_NAME       GetObjDefault(@"USER_NAME")//昵称
//
//#define k_USER_PHONE      GetObjDefault(@"USER_PHONE")//电话
//
//#define K_USER_PHOTO      GetObjDefault(@"USER_PHOTO")//头像
//
//
//#define k_USER_BIRTHDAY            GetObjDefault(@"USER_BIRTHDAY")//生日
//
//#define k_USER_ASSETS            GetObjDefault(@"USER_ASSETS")//资产
//#define k_USER_SUM                 GetObjDefault(@"USER_SUM")//余额
//#define k_USER_BEANS              GetObjDefault(@"USER_BEANS")//金豆
//#define k_IS_MEMBER                GetObjDefault(@"IS_MEMBER")//是否是柜员
//
//#define k_IS_PASSWORD            GetObjDefault(@"IS_PASSWORD")//是否设置支付密码
//
//
//
//
////--------------------接口------------------//
//
#define k_MainUrl(A) [NSString stringWithFormat:@"%@%@",k_HomeUrl,A]
//
//
//#define k_signInUrl(ID) [NSString stringWithFormat:@"http://jiayi.unohacha.com/Weixin/User/sign?userid=%@",ID]
////主链接
//
//#define k_GOODUrl @"http://www.joyjf.com/weixin/products/goodsbuy/id/"
//
#define k_HomeUrl @"http://guomei.unohacha.com/index.php/admin/interface/"

/*
 * 登录
 * phoneNumber     手机号
 * password        密码
 * $token 加密字符串
 * 返回参数 result=>0  该用户未注册
 * 返回参数 result=>1  登录成功
 * 返回参数 result=>2  密码错误
 */
#define k_login @"login"

/*
 * 注册
 * phoneNumber     手机号
 * password        密码
 * codetime        得到验证码的时间
 * 返回参数 result=>0  缺少必要参数
 * 返回参数 result=>1  处理成功
 * 返回参数 result=>2  验证码已失效
 * 返回参数 result=>3  手机已经被注册
 * 返回参数 result=>4  查询数据库失败
 * 返回参数 result=>5  密码小于6位
 * 返回参数 result=>6  注册失败
 * 返回参数 result=>7  无此类型
 */
#define k_register_normal @"register_normal" 

/*
 * 验证手机号发送验证码
 * return $result 返回结果数组
 */
#define k_send_verification_code @"send_verification_code"

/*
 $phone = I("post.phone");
 $password = I("post.password");
 $realname = I("post.realname");
 $sex = I("post.sex");
 $birthday = I("post.birthday");
 $college = I("post.college");
 $admissiontime = I("post.admission");
 $province = I("post.province");
 $city = I("post.city");
 $area = I("post.area");
 $role = I("post.role");
 $art_major_id = I("post.art_major_id");
 */
#define k_add_userinfo @"add_userinfo"

/*
 * 注册第三步
 * 返回艺术资源订阅分页列表
 */
#define k_art_page @"art_page"

/*
 * 插入订阅资源信息
 */
#define k_add_art @"add_art"

/*
 * 返回好友分页列表 遗留问题 好友分类算法
 */
#define k_list_friends @"list_friends"

/*
 * 插入好友信息
 */
#define k_add_friends @"add_friends"